<template>
  <el-aside :width="$store.state.isCollapsed ? '64px' : '200px'">
    <el-menu :collapse="$store.state.isCollapsed"
    :collapse-transition="false"
    :router="true"
    :default-active="router.fullpath"
    >
      <el-menu-item index="/home">
        <el-icon><HomeFilled /></el-icon>
        <span>首页</span>
      </el-menu-item>

      <el-menu-item index="/center">
        <el-icon><Avatar /></el-icon>
        <span>个人中心</span>
      </el-menu-item>

      <el-sub-menu index="/user-manage">
        <template #title>
          <el-icon><UserFilled /></el-icon>
          <span>用户管理</span>
        </template>
          <el-menu-item index="/user-manage/addUser">添加用户</el-menu-item>
          <el-menu-item index="/user-manage/userList">用户列表</el-menu-item>
      </el-sub-menu>
    
      <el-sub-menu index="/product-manage">
        <template #title>
          <el-icon><MessageBox /></el-icon>
          <span>产品管理</span>
        </template>
          <el-menu-item index="/product-manage/productAdd">添加产品</el-menu-item>
          <el-menu-item index="/product-manage/productList">产品列表</el-menu-item>
      </el-sub-menu>

      <el-sub-menu index="/hots-manage">
        <template #title>
          <el-icon><Reading /></el-icon>
          <span>热门新闻</span>
        </template>
          <el-menu-item index="/hots-manage/hotsAdd">添加新闻</el-menu-item>
          <el-menu-item index="/hots-manage/hotsList">新闻列表</el-menu-item>
      </el-sub-menu>

    </el-menu>
  </el-aside>
</template>

<script setup>
import { HomeFilled , Avatar,MessageBox,UserFilled,Reading } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router';
const router = useRouter()
</script>

<style scoped lang="scss">

.el-aside{
  height: 100vh;
  .el-menu{
    height: 100vh;
  }
}
</style>
